from flask import Flask

app = Flask(__name__)

"""
路由的执行步骤
1. 执行 decorator = app.route('/index', methods=['GET','POST'])
2. @decorator
    - decorator(index)
"""
# 使用路由的两种方式
# 方式一
@app.route('/', methods=['GET', 'POST'])
def index():
    return 'index'

# 方式二
def order():
    return "Order"


app.add_url_rule('/order', view_func=order)

if __name__ == "__main__":
    app.run()